package day6;


public class Card {
    private String cardNo;
    private String name;
    private String phone;
    private int point;
    public Card(){
    }

    public void setPoint(int point) {
        this.point = point;
        if(point>600){
            System.out.println("新添加会员积分不能超过600");
            this.point=600;
        }
    }
    public int getPoint() {
        return point;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCardNo() {
        return cardNo;
    }

    public String getName() {
        return name;
    }

    public String getPhone() {
        return phone;
    }

    public Card(String cardNo, String name, String phone, int point){
        this.setCardNo(cardNo);
        this.setName(name);
        this.setPhone(phone);
        this.setPoint(point);
    }
    public void showcardinfo() {
        System.out.println("卡号:" + getCardNo() + "，姓名:" + getName() + "，电话:" + getPhone() + "，积分:" + getPoint());
    }
    public int exchangepoint(int chosen){
        switch (chosen){
            case 1:{
                this.point=getPoint()-100;
                break;
            }
            case 2:{
                this.point=getPoint()-400;
                break;
            }
            case 3:{
                this.point=getPoint()-1000;
                break;
            }
        }
        return chosen;
    }
    public boolean incpoint(String cardNo,int fen){
        this.point=getPoint()+fen;
        return true;
    }

}
